<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<%@ include file="/WEB-INF/jspf/meta/meta.jspf"%>
<title>添加学生信息</title>
<%@ include file="/WEB-INF/jspf/adminPage.jspf"%>
</head>
<body>
	<div style="margin: 20px 0;"></div>
	<div class="easyui-panel" title="添加学生信息" style="width: 550px">
		<div style="padding: 10px 60px 20px 60px">
			<form id="ff" method="post">
				<table cellpadding="5" ;style="text-align: center;">
					<tr>
						<td>学生编号:</td>
						<td><input class="easyui-textbox" type="text"
							name="studentId" data-options="required:true"
							style="width: 300px"></input></td>
					</tr>
					<tr>
						<td>学生姓名:</td>
						<td><input class="easyui-textbox" type="text"
							name="studentName" data-options="required:true"
							style="width: 300px"></input></td>
					</tr>
					<tr>
						<td>学生账号:</td>
						<td><input class="easyui-textbox" type="text"
							name="studentAccount" data-options="required:true"
							style="width: 300px"></input></td>
					</tr>
					<tr>
						<td>学生密码:</td>
						<td><input class="easyui-passwordbox" type="text"
							name="studentPassword" value="12345678"
							data-options="required:true" style="width: 300px"></input></td>
					</tr>
					<tr>
						<td>学生性别:</td>
						<td><input class="easyui-radiobutton" name="studentSex"
							value="男" label="男" /> <input class="easyui-radiobutton"
							name="studentSex" value="女" label="女"></td>
					</tr>
					<tr>
						<td>学生邮箱:</td>
						<td><input class="easyui-textbox" type="text"
							name="studentEmail"
							data-options="required:false,validType:'email'"
							style="width: 300px"></input></td>
					</tr>
					<tr>
						<td>学生电话:</td>
						<td><input class="easyui-textbox" type="text"
							name="studentPhone" data-options="required:false"
							style="width: 300px"></input></td>
					</tr>
					<tr>
						<td>学生生日:</td>
						<td><input class="easyui-textbox" type="text"
							name="studentBirthday" data-options="required:false"
							style="width: 300px"></input></td>
					</tr>
					<tr>
						<td>学生地址:</td>
						<td><input class="easyui-textbox" type="text"
							name="studentAddr" data-options="required:true"
							style="width: 300px"></input></td>
					</tr>
					<tr>
						<td>监护人电话:</td>
						<td><input class="easyui-textbox" type="text"
							name="studentPhone2" data-options="required:true"
							style="width: 300px"></input></td>
					</tr>
					<tr>
						<td>监护人姓名:</td>
						<td><input class="easyui-textbox" type="text"
							name="studentName2" data-options="required:true"
							style="width: 300px"></input></td>
					</tr>
					<tr>
						<td>学生状态:</td>
						<td><select class="easyui-combobox" name="studentStyle"
							data-options="required:true" style="width: 100px;">

								<option value="0">就读中</option>
								<option value="1">已毕业</option>
						</select></td>
					</tr>
					<tr>
						<td>学生班级:</td>
						<td><input id="stuclass" class="easyui-combobox"
							name="gradeId"
							data-options="required:true,valueField:'gradeId',textField:'gradeName',editable:false,url:'<%=request.getContextPath()%>/student/gradeData.json'" />
						</td>
					</tr>
					<tr>
						<td>学生科目:</td>
						<td><input id="stusubject" class="easyui-combobox"
							name="subjectId"
							data-options="required:true,valueField:'subjectId',textField:'subjectName',editable:false,url:'<%=request.getContextPath()%>/student/subjectData.json'" />
						</td>
					</tr>
					<tr>
						<td>学生宿舍:</td>
						<td><input id="sturoom" class="easyui-combobox" name="roomId"
							data-options="valueField:'roomId',editable:false,textField:'roomName',url:'<%=request.getContextPath()%>/student/roomData.json'" />
						</td>
					</tr>


				</table>
			</form>
			<div style="text-align: center; padding: 5px">
				<a href="javascript:void(0)" class="easyui-linkbutton"
					onclick="submitForm()">提交</a> <a href="javascript:void(0)"
					class="easyui-linkbutton" onclick="clearForm()">清除</a>
			</div>
		</div>
	</div>
	<script>
		function submitForm(){
			$('#ff').form({
				url:'<%=request.getContextPath()%>/student/addStu.json',
				onSubmit : function() {
					return $(this).form('validate');
				},
				success : function(data) {
					var d=JSON.parse(data)
					$.messager.show({
						title:'操作提示',
						msg:d.msg,
						timeout:5000,
						showType:'slide'
					}); 
				
					$('#ff').form('clear');
				}
			})

			$('#ff').submit()
		}
		
		function clearForm() {
			$('#ff').form('clear');
		}
	</script>
</body>
</html>